package com.york.tinyrpc.protoss.fault.tolerant;

import com.york.tinyrpc.protoss.fault.retry.FixedIntervalRetryStrategy;
import com.york.tinyrpc.protoss.model.TinyRpcResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * 静默处理
 */
public class FailSafeTolerantStrategy implements TolerantStrategy {

    private static final Logger log = LoggerFactory.getLogger(FailSafeTolerantStrategy.class);


    @Override
    public TinyRpcResponse doTolerant(Map<String, Object> context, Exception e) {
        log.warn("【Fail-Safe】 - 静默处理服务报错: {}", e.getMessage());
        return new TinyRpcResponse();
    }
}
